﻿using Inovout.Cloud.Data.Blob.Models;
using Inovout.Cloud.Models;
using Inovout.Models;

namespace Inovout.Cloud.Storage.Models
{
    partial class Object : DataObject
    {
        private File file;
        public virtual File File { get { return file; } set { file = value; path = file.Path; } }
        private Project project;
        public virtual Project Project
        {
            get { return project ?? Bucket.Project; }
            set { project = value; }
        }
        public virtual string Name { get; set; }
        public virtual Bucket Bucket { get; set; }
        private string path = null;
        public virtual string Path
        {
            get
            {
                if (string.IsNullOrEmpty(path))
                {
                    path = File.Path;
                }
                return path;
            }
        }

    }
}
